<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Model\CardHolder
 *
 * @property-read \App\Model\Cards $card
 * @mixin \Eloquent
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder query()
 * @property int $id
 * @property int $user_id 用户user_id
 * @property int $card_id 名片id
 * @property \Illuminate\Support\Carbon $created_at 创建日期
 * @property \Illuminate\Support\Carbon $updated_at 修改时间
 * @property \Illuminate\Support\Carbon|null $deleted_at 删除时间
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder whereCardId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\CardHolder whereUserId($value)
 */
class CardHolder extends Model
{
    protected $table = 'card_holders';
    protected $primaryKey = 'id';
    protected $dates =['deleted_at'];

    public function card()
    {
        return $this->belongsTo(Cards::class, 'card_id', 'id');
    }
}
